﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using LikeTry.Logic;
using LikeTryCore;
using Contract;

namespace LikeTry
{
    public partial class Preview : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

            var name = Session["UserName"];
            if (name == null)
            {
                Response.Redirect("Logon.aspx");
            }

                var id = Request.QueryString["id"];
                if (id != null)
                {
                    var accountObj = LikeTryCore.LikeTry.GetAccountList();
                    var account = accountObj.Where(x => x.Id == id).FirstOrDefault();
                    if (account != null)
                    {
                        LikeTryCore.LikeTry obj = new LikeTryCore.LikeTry(account.Cookies);
                        Response.Write(obj.Preview());
                        Response.End();
                    }
                }
                else
                {
                    Response.Write("Invalid");
                    Response.End();
                }
            



        }
    }
}